package nc.ui.cmp.settlement;

import nc.ui.fi_print.entry.FiPrintEntry;
import nc.ui.fi_print.entry.FiPrintEntryFactory;
import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pub.bill.BillListPanel;

public class PrintHandler {
	
	private String nodeCode;
	
	private String nodeKey;
	
	private boolean isHeader;
	
	private BillCardPanel billCardPanel;
	
	private BillListPanel billListPanel;
	
	@SuppressWarnings("restriction")
	public void print(BillCardPanel billCardPanel, String pk_corp, String nodeCode, String nodeKey) {
		setNodeCode(nodeCode);
		setNodeKey(nodeKey);
		setBillCardPanel(billCardPanel);
		getBillCardPanel().getBodyPanel().setTableCode("cmp_detail");
		FiPrintEntry entry = FiPrintEntryFactory.createBillCardPanelFiPrintEntry(getBillCardPanel());
		entry.printView(pk_corp, getNodeCode(), getNodeKey());
	}
	
	@SuppressWarnings("restriction")
	public void printList(BillListPanel billListPanel, String pk_corp, String nodeCode, String nodeKey, boolean isHeader) {
		setBillListPanel(billListPanel);
		setNodeCode(nodeCode);
		setNodeKey(nodeKey);
		setHeader(isHeader);
		FiPrintEntry entry = FiPrintEntryFactory.createBillListPanelPrintEntry(getBillListPanel(), isHeader);
		entry.printView(pk_corp, getNodeCode(), getNodeKey());
	}

	public BillCardPanel getBillCardPanel() {
		return billCardPanel;
	}

	public void setBillCardPanel(BillCardPanel billCardPanel) {
		this.billCardPanel = billCardPanel;
	}

	public BillListPanel getBillListPanel() {
		return billListPanel;
	}

	public void setBillListPanel(BillListPanel billListPanel) {
		this.billListPanel = billListPanel;
	}

	public boolean isHeader() {
		return isHeader;
	}

	public void setHeader(boolean isHeader) {
		this.isHeader = isHeader;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}

	public String getNodeKey() {
		return nodeKey;
	}

	public void setNodeKey(String nodeKey) {
		this.nodeKey = nodeKey;
	}
}
